package com.part2.action.system;

public class Part2Util {

	public static String subStringText(Object object, Integer SubLength) {
		if (object != null && SubLength != null) {
			String name = (String) object;
			int nameLength = name.length();
			int endLength = 0;
			if (nameLength > 0 && nameLength != 0)
				endLength = nameLength / 2;
			if (endLength > SubLength)
				endLength = SubLength;
			else if (nameLength < SubLength)
				endLength = nameLength;
			else
				endLength = nameLength;
			return name.substring(0, endLength);
		}
		return null;
	}
}
